import {createRouter,createWebHistory} from 'vue-router';

let router=createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:'/',
            redirect:'/home'
        },
        {
            path:'/login',
            name:'login',
            component:()=>import('@/views/Login/index.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('@/views/Register/index.vue')
        },
        {
            path:'/tabs',
            name:'tabs',
            component:()=>import('@/views/Tabber/index.vue'),
            children:[
                {
                    path:'/home',
                    name:'home',
                    component:()=>import('@/views/Tabber/home/index.vue')
                },
                {
                    path:'/shopping',
                    name:'shopping',
                    component:()=>import('@/views/Tabber/shopping/index.vue')
                },
                {
                    path:'/me',
                    name:'me',
                    component:()=>import('@/views/Tabber/me/index.vue')
                },
                {
                    path:'/message',
                    name:'message',
                    component:()=>import('@/views/Tabber/message/index.vue')
                }
            ]
        },
        {
            path:'/shop/:id',
            name:'shop',
            component:()=>import('@/views/Shop/index.vue')
        },
        {
            path:'/address',
            name:'address',
            component:()=>import('@/views/address/index.vue')
        }
    ]
});

export default router;